<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"  lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:src="@{jquery.js}"></script>
    <script th:src="@{sockjs.js}"></script>
    <script th:src="@{stomp.js}"></script>

</head>
<body>
index
<div id="msg"></div>
</body>
<script>
    var socket = new SockJS("http://localhost:8080/socket");
    console.log(socket);

    var stompClient = Stomp.over(socket);
  stompClient.connect({},function (data) {
      stompClient.subscribe("/server/sendMessageByServer",function (response) {
          console.log(response);
          console.log(response.body);
      })
  })
</script>
</html>